package org.rambadger.command.event;

import org.rambadger.command.validation.UrlIdentifier;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

public abstract class SystemRoleChanged {
    protected final String username;

    protected SystemRoleChanged(String username) {
        this.username = username;
    }

    @UrlIdentifier @NotNull
    public String getUsername() {
        return username;
    }

    @Override
    public String toString() {
        return this.getClass().getSimpleName()+"{" +
                "username='" + username + '\'' +
                '}';
    }

   public static class AdminGranted extends SystemRoleChanged implements Serializable {
       private static final long serialVersionUID = -2157389607102480531L;
       public AdminGranted(String username) { super(username); }
   }

    public static class AdminRevoked extends SystemRoleChanged implements Serializable {
        private static final long serialVersionUID = -5665962403421691608L;
        public AdminRevoked(String username) { super(username); }
    }

    public static class AccessGranted extends SystemRoleChanged implements Serializable {
        private static final long serialVersionUID = 8403190905278274095L;
        public AccessGranted(String username) { super(username); }
    }

    public static class AccessRevoked extends SystemRoleChanged implements Serializable {
        private static final long serialVersionUID = 339451721252966148L;
        public AccessRevoked(String username) { super(username); }
    }
}
